3.891 \(\int (a+i a \tan (e+f x))^2 (c-i c \tan (e+f x)) \, dx\)

Optimal. Leaf size=25 \[ -\frac {i c (a+i a \tan (e+f x))^2}{2 f} \]

[Out]

-1/2*I*c*(a+I*a*tan(f*x+e))^2/f

________________________________________________________________________________________

Rubi [A]  time = 0.06, antiderivative size = 36, normalized size of antiderivative = 1.44, number of steps used = 4, number of rules used = 4, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.138, Rules used = {3522, 3486, 3767, 8} \[ \frac {a^2 c \tan (e+f x)}{f}+\frac {i a^2 c \sec ^2(e+f x)}{2 f} \]

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[e + f*x])^2*(c - I*c*Tan[e + f*x]),x]

[Out]

((I/2)*a^2*c*Sec[e + f*x]^2)/f + (a^2*c*Tan[e + f*x])/f

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3486

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(b*(d*Sec[
e + f*x])^m)/(f*m), x] + Dist[a, Int[(d*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e, f, m}, x] && (IntegerQ[2
*m] || NeQ[a^2 + b^2, 0])

Rule 3522

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Di
st[a^m*c^m, Int[Sec[e + f*x]^(2*m)*(c + d*Tan[e + f*x])^(n - m), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] &&
EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0] && IntegerQ[m] &&  !(IGtQ[n, 0] && (LtQ[m, 0] || GtQ[m, n]))

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rubi steps

\begin {align*} \int (a+i a \tan (e+f x))^2 (c-i c \tan (e+f x)) \, dx &=(a c) \int \sec ^2(e+f x) (a+i a \tan (e+f x)) \, dx\\ &=\frac {i a^2 c \sec ^2(e+f x)}{2 f}+\left (a^2 c\right ) \int \sec ^2(e+f x) \, dx\\ &=\frac {i a^2 c \sec ^2(e+f x)}{2 f}-\frac {\left (a^2 c\right ) \operatorname {Subst}(\int 1 \, dx,x,-\tan (e+f x))}{f}\\ &=\frac {i a^2 c \sec ^2(e+f x)}{2 f}+\frac {a^2 c \tan (e+f x)}{f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.13, size = 45, normalized size = 1.80 \[ \frac {a^2 c \left (-2 \tan ^{-1}(\tan (e+f x))+i \tan ^2(e+f x)+2 \tan (e+f x)+2 f x\right )}{2 f} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[e + f*x])^2*(c - I*c*Tan[e + f*x]),x]

[Out]

(a^2*c*(2*f*x - 2*ArcTan[Tan[e + f*x]] + 2*Tan[e + f*x] + I*Tan[e + f*x]^2))/(2*f)

________________________________________________________________________________________

fricas [B]  time = 0.47, size = 50, normalized size = 2.00 \[ \frac {4 i \, a^{2} c e^{\left (2 i \, f x + 2 i \, e\right )} + 2 i \, a^{2} c}{f e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^2*(c-I*c*tan(f*x+e)),x, algorithm="fricas")

[Out]

(4*I*a^2*c*e^(2*I*f*x + 2*I*e) + 2*I*a^2*c)/(f*e^(4*I*f*x + 4*I*e) + 2*f*e^(2*I*f*x + 2*I*e) + f)

________________________________________________________________________________________

giac [B]  time = 0.78, size = 53, normalized size = 2.12 \[ \frac {4 i \, a^{2} c e^{\left (2 i \, f x + 2 i \, e\right )} + 2 i \, a^{2} c}{f e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^2*(c-I*c*tan(f*x+e)),x, algorithm="giac")

[Out]

(4*I*a^2*c*e^(2*I*f*x + 2*I*e) + 2*I*a^2*c)/(f*e^(4*I*f*x + 4*I*e) + 2*f*e^(2*I*f*x + 2*I*e) + f)

________________________________________________________________________________________

maple [A]  time = 0.02, size = 27, normalized size = 1.08 \[ \frac {a^{2} c \left (\frac {i \left (\tan ^{2}\left (f x +e \right )\right )}{2}+\tan \left (f x +e \right )\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))^2*(c-I*c*tan(f*x+e)),x)

[Out]

1/f*a^2*c*(1/2*I*tan(f*x+e)^2+tan(f*x+e))

________________________________________________________________________________________

maxima [A]  time = 1.02, size = 32, normalized size = 1.28 \[ -\frac {-i \, a^{2} c \tan \left (f x + e\right )^{2} - 2 \, a^{2} c \tan \left (f x + e\right )}{2 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^2*(c-I*c*tan(f*x+e)),x, algorithm="maxima")

[Out]

-1/2*(-I*a^2*c*tan(f*x + e)^2 - 2*a^2*c*tan(f*x + e))/f

________________________________________________________________________________________

mupad [B]  time = 4.73, size = 26, normalized size = 1.04 \[ \frac {a^2\,c\,\mathrm {tan}\left (e+f\,x\right )\,\left (2+\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}{2\,f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*tan(e + f*x)*1i)^2*(c - c*tan(e + f*x)*1i),x)

[Out]

(a^2*c*tan(e + f*x)*(tan(e + f*x)*1i + 2))/(2*f)

________________________________________________________________________________________

sympy [B]  time = 0.25, size = 68, normalized size = 2.72 \[ \frac {4 i a^{2} c e^{2 i e} e^{2 i f x} + 2 i a^{2} c}{f e^{4 i e} e^{4 i f x} + 2 f e^{2 i e} e^{2 i f x} + f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))**2*(c-I*c*tan(f*x+e)),x)

[Out]

(4*I*a**2*c*exp(2*I*e)*exp(2*I*f*x) + 2*I*a**2*c)/(f*exp(4*I*e)*exp(4*I*f*x) + 2*f*exp(2*I*e)*exp(2*I*f*x) + f
)

________________________________________________________________________________________